package cc.rengu.redp.bizimpl.igas.controller;

import cc.rengu.redp.bizimpl.igas.service.OrgAbolishAndMergeService;
import cc.rengu.redp.bizimpl.upmp.vo.OperationResult;
import cc.rengu.redp.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 机构撤并Controller
 */
@Api(tags = "系统监控:机构撤并")
@Slf4j
@RestController
@RequestMapping("/admin/igas/OrgAbolishAndMerge")
public class OrgAbolishAndMergeController extends BaseController {
    @Autowired
    OrgAbolishAndMergeService orgAbolishAndMergeService;

    @GetMapping("/list")
    @ApiOperation(value = "列表查询")
    public List<Map> list(HttpServletRequest request) {
        String instId = request.getParameter("instId");
        String signinstid = request.getParameter("signinstid");
        return orgAbolishAndMergeService.findByPage(instId,signinstid);
    }


    @PostMapping("/edit")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "optFlag", value = "操作类型", required = true, dataType = "String")
    })
    public OperationResult editSave(HttpServletRequest request) {
        return orgAbolishAndMergeService.saveData(request);
    }
}
